package com.zjitc.dao;

import com.zjitc.model.User;
import org.apache.ibatis.annotations.Param;

/**
 * Create by IntelliJ IDEA
 *
 * @author: jsonor
 * @date-Time: 2018/3/28 14:26
 * @description:
 */
public interface UserDao {

  int userNameCount(String username);
  User findByUserNameAndPassword(@Param("username") String username,
      @Param("password") String password);


  int register(User user);

  int checkEmail(String str);

  User findByUserName(String username);

  String userQuestion(String username);

  int checkPassword(String passwordOld);

  int updatePassword(@Param("username") String username, @Param("passwordNew") String passwordNew);

  int updateInformation(
      @Param("username")  String username,
      @Param("email") String email,
      @Param("phone") String phone,
      @Param("question")String question,
      @Param("answer")String answer);

  int checkQuestion(@Param("username") String username,
      @Param("question")  String question);

  int checkAnswer( @Param("username") String username,
      @Param("answer")  String answer);
}
